// 修改会话状态类型
export type SessionStatus = 'ACTIVE' | 'ENDED' | 'CLOSED'

// 基础会话类型
export interface ChatSession {
  id: number
  appointmentId: number
  studentId: number
  counselorId: number
  studentName: string
  counselorName: string
  status: SessionStatus
  startTime: string
  endTime: string
  lastMessageId?: number
  studentUnread: number
  counselorUnread: number
}

// 修改会话显示类型
export interface ChatSessionDisplay {
  id: number
  appointmentId: number
  studentId: number
  counselorId: number
  status: SessionStatus  // 使用新定义的状态类型
  startTime: string
  endTime: string
  lastMessageId?: number
  studentUnread: number
  counselorUnread: number
  studentName: string
  counselorName: string
  studentAvatar?: string
  counselorAvatar?: string
  lastMessage?: string
  name?: string
  avatar?: string
}

// 修改消息类型
export interface ChatMessage {
  id: number        // 必需字段
  appointmentId: number
  content: string
  type: 'text' | 'image' | 'file' | 'system'
  senderId: number
  receiverId: number
  time: string
  status: 'ERROR' | 'SENDING' | 'DELIVERED' | 'RECALLED' | 'EXPIRED'
  isSelf?: boolean
  senderName?: string
  senderAvatar?: string
  receiverName?: string
  receiverAvatar?: string
  fileUrl?: string
  fileName?: string
}

// WebSocket 消息响应类型
export interface WebSocketResponse {
  messageId: number  // 服务器生成的消息ID，必需字段
  id?: number       // 临时ID，可选字段
  status: string
  content: string
  type: string
  senderId: number
  receiverId: number
  time: string
  appointmentId: number
  emotionScore?: number  // 情感分析分数
  riskLevel?: 'LOW_RISK' | 'MEDIUM_RISK' | 'HIGH_RISK'  // 风险等级
} 